package com.tgy.基础学习.Thread.Normal;

/**
 * @author 送你一块二向箔
 * @date 2021/11/08 13:50
 */

/**
 * 线程插队
 */
public class ThreadJoin implements Runnable{
    @Override
    public void run() {
        for (int i = 0; i < 1000; i++) {
            System.out.println("线程vip运行"+i);
        }
    }

    public static void main(String[] args) throws InterruptedException {
        ThreadJoin threadJoin = new ThreadJoin();
        Thread thread = new Thread(threadJoin);
        thread.start();
        //new Thread(threadJoin).start();

        //主线程
        for (int i = 0; i < 500; i++) {
            if(i == 200){
                thread.join();
            }
            System.out.println("main"+i);
        }
    }
}

//新生，就绪，运行，阻塞，死亡
